Parallel programming allows developers to devote multiple resources, such as central processing units (CPUs) and threads, concurrently to an application. Threads are often synchronized through mutual-exclusion locks (mutexes) to coordinate access to shared resources. For example, when a thread is attempting to write to a particular data object, a lock manager may require the thread to obtain a mutex before the thread is permitted to perform the write operation. The mutex on the data object prevents two or more threads from concurrently updating, deleting, and/or otherwise modifying a data object.
Parallel programming may boost performance linearly based on the degree of parallelism. For example, a set of operations that is split between four different processors may be executed up to four times as quickly compared to a single processor. Thus, the speed and responsiveness of complex applications may be significantly increased. However, in some cases, thread synchronization may slow performance and ultimately limit the degree of parallelism that may be successfully exploited. When performance fails to scale linearly, developers may face a difficult task in determining the underlying reasons.
The approaches described in this section are approaches that could be pursued, but not necessarily approaches that have been previously conceived or pursued. Therefore, unless otherwise indicated, it should not be assumed that any of the approaches described in this section qualify as prior art merely by virtue of their inclusion in this section.